
package com.jgp.glmeeting.ema.util;

import com.jgp.glmeeting.ema.server.jwsserver.sms.*;
import org.hibernate.service.spi.ServiceException;

import java.rmi.RemoteException;

/**
 * webservice客户端测试程序
 *
 * @author    ligenglin1
 * 
 * <p>Modification History:</p>
 * <p>Date             Author      Description</p>
 * <p>--------------------------------------------------------------</p>
 * <p>2016-2-1     ligenglin1              new</p>
 * <p>  </p>
 */
public class AxisClientMainTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		MtMessage msg = new MtMessage();
		msg.setContent("测试用短消息");
		msg.setPhoneNumber(new String[] { "18562183371","18654809204","13655448732" });

		try {
			SmsOperatorImpServiceLocator service = new SmsOperatorImpServiceLocator();
			ISmsOperator operator = service.getSmsOperatorImpPort();
			MtMessageRes msgRes = operator.sendSms("gl96660", MD5.MD5Encode("lz96660"), "12", msg); // smsType12
			
			System.out.println("smsId: " + msgRes.getSmsId());
			System.out.println("subStat: " + msgRes.getSubStat());
			System.out.println("subStatDescription: " + msgRes.getSubStatDes());
			if (msgRes.getResDetail() != null) {
				for (MtMessageResDetail detail : msgRes.getResDetail()) {
					System.out.println("phoneNumber: " + detail.getPhoneNumber() + "\t state: " + detail.getStat() + "\t state description: " + detail.getStatDes());
				}
			}
			
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ServiceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (javax.xml.rpc.ServiceException e) {
			e.printStackTrace();
		}
	}

}
